package com.example.mybatisdemo.demos.web.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.mybatisdemo.demos.web.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserInfoMapper extends BaseMapper<UserInfo> {
    @Select("select * from user_info")
    List<UserInfo>selectAll();


@Select("SELECT * FROM `user_info` WHERE username=#{name}  and `password`=#{p}")
    List<UserInfo> selectByNamePws(@Param("name") String n,@Param("p") String p);

@Select("SELECT * FROM `user_info` WHERE `id`=#{id}")
UserInfo selectById(Integer id);



}
